package dd.ding.service.Impl;

import dd.ding.dao.UserDao;
import dd.ding.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//@Component
@Service
public class UserServiceImpl implements UserService {
    public UserServiceImpl() {
        System.out.println("userService服务无参构造方法");
    }

    //导入依赖
    //最简便的方法  暴力反射  不推荐使用，但是可以使用
//    @Autowired
//    UserDao userDao;
    @Qualifier("userStuDaoImpl")
    @Autowired
    private UserDao userStuDaoImpl;
    @Qualifier("userDaoImpl")
    @Autowired
    private UserDao userDaoImpl;
//    @Autowired
//    public UserServiceImpl(UserDao userDao) {
//        this.userDao = userDao;
//    }

//    @Autowired
//    public void setUserDao(UserDao userDao) {
//        System.out.println("set UserDao -----");
//        this.userDao = userDao;
//    }

    public void getList() {
//        userDao.getList();
        userDaoImpl.getList();
        userStuDaoImpl.getList();
    }
}
